//
//  EmptyView.swift
//  Exchange
//
//  Created by rui on 2018/6/13.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit

class EmptyView: UIView {
    
    private lazy var stateLabel: UILabel = {
        let lbl = UILabel()
        lbl.themeTextColor = ThemeManager.ThemeColorKeys.text1
        lbl.textAlignment = .center
        lbl.numberOfLines = 0
        lbl.themeBackground = ThemeManager.ThemeColorKeys.background
        lbl.font = UIFont.systemFont(ofSize: 14)
        return lbl
    }()
    
    private lazy var imageView:UIImageView = {
        let imageView = UIImageView()
        imageView.themeImage = ThemeManager.ThemeImageKeys.nomessage
        return imageView
    }()
    
    
    var message: String? {
        didSet {
            stateLabel.text = message
        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.themeBackground = ThemeManager.ThemeColorKeys.background
        self.addSubview(imageView)
        imageView.snp.makeConstraints { (make) in
            make.centerX.centerY.equalToSuperview()
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
//        self.stateLabel.frame = CGRect(x: 20, y: 0, width: self.width - 40, height: self.height)
//        self.addSubview(self.stateLabel)
    }
}
